package com.bookstore.back.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 图书评论实体类
 * 
 * @author 程序猿_Ti
 * @since 2025-07-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("book_review")
public class BookReview implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 评论ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 图书ID
     */
    @TableField("book_id")
    private Integer bookId;

    /**
     * 用户ID
     */
    @TableField("user_id")
    private Integer userId;

    /**
     * 评论内容
     */
    @TableField("content")
    private String content;

    /**
     * 评分：1-5分
     */
    @TableField("rating")
    private Integer rating;

    /**
     * 点赞数
     */
    @TableField("likes")
    private Integer likes;

    /**
     * 状态：0-隐藏 1-显示
     */
    @TableField("status")
    private Integer status;

    /**
     * 创建时间
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

}
